<?php
include('connect.php');

$sql = "select chat_room.id chatid, sf_guard_user.id, sf_guard_user.nickname, sf_guard_user.photo, chat_room.is_active from chat_room, sf_guard_user where chat_room.to_id=sf_guard_user.id and chat_room.from_id=".$_GET['id'];
$rez = mysql_query($sql);
$str = '<table>';
while(list($chatid,$id,$$name,$photo, $status)=mysql_fetch_row($rez))
{
if($status==1)
{
   $st =='active';
}
else
{
   $st =='noactive';
}

   $str.='<tr><td><a href="/_index.php/multichat/setactive?id='.$chatid.'"><img src="/uploads/users/avatar/_thumbnail/'.$photo.'"></td><td>'.$st.'</td><td><a href="/_index.php/multichat/exit?id='.$chatid.'">exit</a></td></tr>';
}
$str .= '</table>';
echo $str;
?>